def move(keyword: str, x: int, y: int):
    if keyword == "up":
        print("机器人正在上移")
        y += 1
    elif keyword == "down":
        print("机器人正在下移")
        y -= 1
    elif keyword == "right":
        print("机器人正在右移")
        x += 1
    elif keyword == "left":
        print("机器人正在左移")
        x -= 1
    return x, y


if __name__ == "__main__":
    x, y = 0, 0
    while True:
        keyword = input("请输入指令：")
        x, y = move(keyword, x, y)
        if x == 10 and y == 10:
            print("到达终点")
            break
        print("当前位置为 ({}, {})".format(x, y))
